import { contextName } from "json!../websiteConfig";

(function () {

    let node_modules = "/node_modules";
    let lib = "assert/lib";
    requirejs.config({
        context: contextName,
        shim: {
            fetch: {
                exports: 'fetch'
            },
            controls: {
                deps: ['react-dom', 'react']
            },
            mobileControls: {
                exports: 'controls',
                deps: ['hammer', 'bezier-easing', 'react']
            },
            userServices: {
                exports: 'userServices'
            },
        },
        baseUrl: './',
        paths: {

            css: `${lib}/css`,
            less: `${lib}/require-less-0.1.5/less`,
            lessc: `${lib}/require-less-0.1.5/lessc`,
            normalize: `${lib}/require-less-0.1.5/normalize`,
            text: `${lib}/text`,

            "js-md5": `${node_modules}/js-md5/src/md5`,
            "react": `${node_modules}/react/umd/react.development`,
            "react-dom": `${node_modules}/react-dom/umd/react-dom.development`,
            "maishu-wuzhui": `${node_modules}/maishu-wuzhui/dist/index`,
            'maishu-chitu': `${node_modules}/maishu-chitu/dist/index`,
            "maishu-dilu": `${node_modules}/maishu-dilu/dist/index`,
            "maishu-chitu-react": `${node_modules}/maishu-chitu-react/dist/index`,
            "maishu-wuzhui-helper": `${node_modules}/maishu-wuzhui-helper/dist/index`,
            "maishu-chitu-service": `${node_modules}/maishu-chitu-service/dist/index`,
            "maishu-jueying": `${node_modules}/maishu-jueying/dist/index`,
            "maishu-ui-toolkit": `${node_modules}/maishu-ui-toolkit/dist/index`,
            "maishu-services-sdk": `${node_modules}/maishu-services-sdk/dist/index`,
            "maishu-haoyi-shop": `${node_modules}/maishu-haoyi-shop/`,
            "modules": "mobile/modules",
            
        }
    });

    // requirejs(["css!lib/Font-Awesome-3.2.1/css/font-awesome"]);
    requirejs({ context: contextName }, ['mobile/user-application'],
        function (appExports) {
            let app = appExports.app;
            app.run();
        }
    )
})()